<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
</head>
<body>
<h1>Hello</h1>
<p>${}获取对象的属性值</p>
<p th:text="${user.username}">username</p>
<p th:text="${user.getUsername()}">username</p>
<p>@{}</p>
<a th:href="@{https://www.baidu.com/}">百度一下</a>
<a th:href="@{/index}">跳转本项目内部链接</a>
<a th:href="@{https://www.baidu.com(id=1,name=${user.username})}">@{}传参</a>

<p>*{}表达式</p>
<div th:object="${user.role}">
    <p>RoleName: <span th:text="${user.role.getRoleName()}">$</span>.</p>
    <p>RoleName: <span th:text="${#object.getRoleName()}">$</span>.</p>
    <p>RoleName: <span th:text="*{roleName}">*</span>.</p>
</div>

<div th:text="${#dates.format(user.birthday,'dd/MMM/yyyy HH:mm')}"></div>
<p>~{}表达式</p>
<div th:insert="~{msg::#common}"></div>
</body>
</html>